# -*- coding: utf-8 -*-
"""
    # @Author : xiaowei
    # @Time : 2022/8/11 18:42
    # @Software: PyCharm
"""
import requests
import re
import time

# 获取网页
response = requests.get(url="https://www.sanchuangedu.cn/")
# print(response.text) # 获取网页
# img = "luogan.png"
# 获取照片的地址
result = re.findall(r"^<img \w+=([A-z]+(?:.png|.jpg))",response.text,re.M)
# print(result)

for img in result:
    response = requests.get(url="https://www.sanchuangedu.cn/"+img)
    nowtime = time.strftime("%Y%m%d%H%M",time.localtime())
    # print(nowtime)
    with open(f"{nowtime} {img}.png","wb") as fp:
        fp.write(response.content)
        print(f"{img} 已下载完成！")
print("全部下载完成！！！")